/*
 *  engine.h
 *  
 *  Created by James Dykstra
 *	Team 5
 *
 *  Copyright 2010 Michigan Technological University. All rights reserved.
 */

#ifndef ENGINE_H
#define ENGINE_H

#define FPS 25
#define POWERUP_DELAY_MIN 250
#define POWERUP_DELAY_RANGE 250

#include "renderer.h"
#include "map.h"
#include "timer.h"
#include "logic.h"
#include "blackhole.h"
#include "tinyxml/tinyxml.h"
#include "playerControlledShip.h"
#include "network.h"
#include "SDL/SDL_thread.h"
#include "circleAI.h"
#include "powerup.h"
#include "sys/stat.h"
#include "sys/types.h"
#include "pwd.h"


class GameEngine
{
	public:
		GameEngine(const char *ip);
		~GameEngine();
		
		void 		run();
		void        getSetting( std::string * settingreturn, std::string settingname );
		void        setSetting( std::string * settingreturn,std::string settingname, std::string settingvalue );
		
		void        getSetting( std::string * settingreturn, const char * settingname );
		void        setSetting( std::string * settingreturn,const char * settingname, const char * settingvalue );
	private:
        Renderer 	*renderer;
		Map      	*map;
		Network		*net;
		SDL_Thread	*sthread;
		Logic		*logic;
		Fighter 	*player;
		Blackhole	*blackhole;
		Timer    	*fps;
		Timer	 	*delta;
		Powerup		*powerup;
		int			powerupCount;
		SDL_Event 	keyevent;
		Opponent	*opponents[MAX_CLIENTS];
		Sound   	*sound;		
		void 		draw();
		void 		update();
		void		netUpdate();
		void 		capFrameRate();
		bool		handleInput();
		bool		showHitboxes;
		bool		networkset;
		SDL_Rect	lastPos;
		double		lastAngle;
        std::string ipaddress,key_togglehitboxes, key_forward, key_backward, key_left, key_right, key_fire, key_firewide, key_special;

};

#endif
